package com.example.demo.design.observe_pattern.two;

/**
 * @Author: liull
 * @Description:
 * @Date: Created in 9:46 2021/4/2
 * @Modified By:
 */
public class ConcreteAllyControllerCenter extends AllyControllerCenter {
    public ConcreteAllyControllerCenter(String allyName) {
        super(allyName);
        System.out.println(allyName + "战队组建成功！");
        System.out.println("----------------------------");
    }

    @Override
    public void notifyObserver(String name) {
        System.out.println(this.allyName + "战队紧急通知，盟友" + name + "来支援");
        for (Observer player : players) {
            if (!player.getName().equalsIgnoreCase(name)) {
                player.help();
            }
        }

    }
}
